/**
 * Copyright (c) 2017 hadlinks, All Rights Reserved.
 */
package com.bugull.farm.core.proxy;

import java.lang.reflect.Method;

/**
 * Project Name: bugu-farm-household 
 * Package Name: com.bugull.farm.core.proxy 
 * ClassName: BeforeHandler 
 * Function: TODO ADD FUNCTION.  
 * date: 2017/11/7 16:41
 * @author songwei (songw@hadlinks.com)
 * @since JDK 1.8 
 */
public abstract class BeforeHandler extends AbstractHandler {

    public abstract void handleBefore(Object proxy, Method method, Object[] args);

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        handleBefore(proxy, method, args);
        return method.invoke(getTargetObject(), args);
    }
}
